<!doctype html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<script>
    function getTableData() {
        return new Promise(resolve => {
            setTimeout(() => {
                resolve({code: 200})
            }, 500)
        })
    }

    function getTableData2() {
        return new Promise(resolve => {
            setTimeout(() => {
                resolve({code: 400})
            }, 500)
        })
    }

    function otherReq() {
        console.log('请求触发2222')
    }

    async function submit() {
        const result = await getTableData()
        const result2 = result.code === 200 && await getTableData2()
        result2.code === 400 && otherReq()
    }

    submit()
</script>
</body>
</html>
